package com.yzy.baselibrary.di

import com.yzy.baselibrary.integration.AppManager
import com.yzy.baselibrary.integration.IRepositoryManager
import com.yzy.baselibrary.integration.RepositoryManager
import com.google.gson.Gson
import org.kodein.di.Kodein
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.singleton

/**
 *description: AppModule.
 *@date 2018/10/12 14:40.
 *@author: YinZeYu.
 */
const val KODEIN_MODULE_APP_TAG = "appModule"

val appModule = Kodein.Module(KODEIN_MODULE_APP_TAG) {

  //AppManager
  bind<AppManager>() with singleton { AppManager(com.yzy.baselibrary.base.BaseApplication.INSTANCE) }

  //IRepositoryManager
  bind<IRepositoryManager>() with singleton { RepositoryManager(instance(), instance()) }
  //GSON
  bind<Gson>() with singleton { Gson() }
}
